// 三级导航相关请求
import request from "@/utils/request"
import type { CategoryListModel } from "@/api/product/model/category"

enum Api {
  getCategory1ListApi = "/admin/product/getCategory1",
  getCategory2ListApi = "/admin/product/getCategory2",
  getCategory3ListApi = "/admin/product/getCategory3",
  // 删除
  removeTrademark = "/admin/product/baseCategoryTrademark/remove",
}

// 获取一级分类数据
export const reqGetCategory1List = () => {
  return request.get<any, CategoryListModel>(Api.getCategory1ListApi)
}

// 获取二级分类数据
export const reqGetCategory2List = (id: number) => {
  return request.get<any, CategoryListModel>(Api.getCategory2ListApi + `/${id}`)
}

// 获取三级分类数据
export const reqGetCategory3List = (id: number) => {
  return request.get<any, CategoryListModel>(Api.getCategory3ListApi + `/${id}`)
}

// 删除分类管理数据
export const reqDeleteClassification = (
  category3Id: number,
  trademarkId: number
) => {
  return request.delete<any, any>(
    Api.removeTrademark + `/${category3Id}/${trademarkId}`
  )
}
